#!/bin/bash

# 初始化选项 {{{
Color_off='\033[0m' # Text Reset

# 定义颜色
Black='\033[0;30m'  # Black
Red='\033[0;31m'    # Red
Green='\033[0;32m'  # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m'   # Blue
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m'   # Cyan
White='\033[0;37m'  # White

# 当前版本
VERSION='0.0.3'
# 系统信息
SYSTEM="$(uname -s)"
INFO=$(cat /etc/issue)
ShellFolder=$(cd "$(dirname -- "$0")";pwd)

# 欢迎内容
function welcome() {
	echo -e "\033[36m
   ____     _ __          __  ____             __
  /  _/__  (_) /_        / / / / /  __ _____  / /___ __
 _/ // _ \/ / __/       / /_/ / _ \/ // / _ \/ __/ // /
/___/_//_/_/\__/        \____/_.__/\_,_/_//_/\__/\_,_/

        Version: ${VERSION}     by: DavyMai
        System:  ${INFO%\\l}
\033[0m"
}

# 成功/信息/错误/警告 {{{
msg() {
  printf '%b\n' "$1" >&2
}

info() {
  msg "${Blue}[➭]${Color_off} ${1}${2}"
}

warn() {
  msg "${Red}[►]${Color_off} ${1}${2}"
}

error() {
  msg "${Red}[✘]${Color_off} ${1}${2}"
  exit 1
}
success() {
  msg "${Green}[✔]${Color_off} ${1}${2}"
}

# 命令检查
cmdCheck() {
  if ! hash $1 &>/dev/null; then
    error "Command [${1}] not found"
    return 1
  fi
}

# 安装
aptInstall() {
  # sudo rm -rf /var/lib/dpkg/lock
  # sudo rm -rf /var/cache/apt/archives/lock
  info "Install ${1}"
  warn "Waiting"
  if sudo apt-get install -y $1 >/dev/null; then
    success "Install ${1} Success\n"
  else
    fail "Install ${1} Failed"
  fi
}

sudo cp $ShellFolder/config/sshscy /etc/ssh/sshd_config.d/sshscy.conf

# 更新和升级系统
updateANDUpgradeSystem() {
  info "Update system"
  warn "Waiting"
  # DNS
  sudo sed -i '/^#DNS=/s/#DNS=/DNS=8.8.4.4 114.114.114.114/g' /etc/systemd/resolved.conf
  sudo systemctl restart systemd-resolved
  # github 520 GitHub 访问提速
  sudo sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >>/etc/hosts
  sudo systemctl restart systemd-networkd
  # sudo rm -rf /var/lib/dpkg/lock
  # sudo rm -rf /var/cache/apt/archives/lock
  sudo apt-get update >/dev/null
  sudo apt-get upgrade -y -q
}

# 更改源为中国
changeSourceForChina() {
  if [ $? -eq 1 ]; then
    # etc/sources.list
    info "[USTC] System /etc/apt/sources.list"
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    sudo sed -i 's/[a-zA-Z]*.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
    # sudo sed -i 's/[a-zA-Z]*.archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
  elif [ $? -eq 2 ]; then
    # python pip 源
    info "[tsinghua] python pip ~/.pip/pip.conf"
    mkdir -p ~/.pip
    echo -e "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple" >>~/.pip/pip.conf
  elif [ $? -eq 3 ]; then
    # docker dameon.json
    info "[USTC] docker /etc/docker/daemon.json"
    sudo echo -e "{\n\"registry-mirrors\": [\"https://docker.mirrors.ustc.edu.cn\"]\n}" >/etc/docker/daemon.json
  fi
}

# 基本工具安装
basicToolsInstall() {
  aptInstall "curl"
  aptInstall "git"
  aptInstall "vim"
  aptInstall "sed"
}

# 删除多余用户和组
DeleteUsers() {
  #Delete Useless Users
  info "User Configure"
  info "Delete Useless Users"
  sudo userdel -r adm
  sudo userdel -r lp
  sudo userdel -r games
  sudo userdel -r ftp
  sudo userdel -r video
  sudo groupdel adm
  sudo groupdel lp
  sudo groupdel video

}

# 创建新用户
CreateUsers() {
  # Create User
  info "Create User"
  read -p "Enter your user name: " usname
  printf "Enter password: \n"
  read -s -r pass
  printf "Confirm password: \n"
  read -s -r passwd
  if [ $pass != $passwd ]; then
    printf "The password was entered incorrectly twice, please re-enter: \n"
    userConfigure
  else
    printf "Enter your ssh-rsa key (*Only allow key login after restart, prohibit root user login with password): \n"
    read rsakey
    #useradd -G sudo -s $(which zsh) $usname && echo $Password | passwd --stdin $usname &>/dev/null
    sudo useradd -G sudo $usname && echo $Password | passwd --stdin $usname &>/dev/null
    mkdir -p /home/$usname/.ssh && chown $usname:$usname /home/$usname/.ssh && chmod 700 /home/$usname/.ssh
    sudo echo "$rsakey" >>/home/$usname/.ssh/authorized_keys && chown $usname:$usname /home/$usname/.ssh/authorized_keys && chmod 600 /home/$usname/.ssh/authorized_keys
    sudo echo "$usname  ALL=(ALL:ALL) NOPASSWD: ALL" >>/etc/sudoers
  fi
  
}

# 常用工具
commonTools() {
  case ${1} in
  1)
    info "aria2: a lightweight multi-protocol & multi-source command-line download utility"
    aptInstall aria2
    ;;
  2)
    info "tldr: Simplified and community-driven man pages"
    aptInstall tldr
    ;;
  3)
    info "ag: A code-searching tool similar to ack, but faster."
    aptInstall silversearcher-ag
    ;;
  4)
    info "fd: A simple, fast and user-friendly alternative to 'find'"
    # Only support for Ubuntu 19.04 or newer
    # aptInstall fd-find
    wget --no-check-certificate https://github.com/sharkdp/fd/releases/download/v8.4.0/fd_8.4.0_amd64.deb
    sudo dpkg -i fd_8.4.0_amd64.deb
    rm -f fd_8.4.0_amd64.deb
    ;;
  5)
    # Only support for Ubuntu 19.10 or newer
    # aptInstall bat
    info "A cat(1) clone with syntax highlighting and Git integration."
    wget --no-check-certificate https://github.com/sharkdp/bat/releases/download/v0.21.0/bat_0.21.0_amd64.deb
    sudo dpkg -i bat_0.21.0_amd64.deb
    rm -f bat_0.21.0_amd64.deb
    ;;
  6)
    # Only support for Ubuntu 20.10 or newer
    # aptInstall exa
    info "exa is a modern replacement for ls."
    wget --no-check-certificate https://github.com/ogham/exa/releases/download/v0.10.1/exa-linux-x86_64-v0.10.1.zip
    unzip exa-linux-x86_64-v0.10.1.zip
    sudo mv bin/exa /usr/local/bin/
    if [ -d "/usr/local/share/zsh/site-functions" ]; then
      cp completions/exa.zsh /usr/local/share/zsh/site-functions/
    fi
    rm -rf bin/ man/ completions/ exa-linux-x86_64-v0.10.1.zip
    ;;
  esac
}

pythonDevelopEnv() {
  case ${1} in
  1)
    info "pip3"
    aptInstall "python3-dev python3-pip"
    ;;
  2)
    info "pyenv: Simple Python version management"
    aptInstall "make build-essential libssl-dev zlib1g-dev libbz2-dev
                        libreadline-dev libsqlite3-dev wget --no-check-certificate curl llvm libncurses5-dev libncursesw5-dev
                        xz-utils tk-dev libffi-dev liblzma-dev"
    curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
    echo '# pyenv' /.zshrc >>~
    echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >>~/.zshrc
    echo 'eval "$(pyenv init -)"' >>~/.zshrc
    echo 'eval "$(pyenv virtualenv-init -)"' >>~/.zshrc
    ;;
  3)
    info "pipenv: Python Development Workflow for Humans"
    if cmdCheck pip3 -eq 0; then
      # why not use pip3: https://stackoverflow.com/questions/49836676/error-after-upgrading-pip-cannot-import-name-main
      python3 -m pip install --user pipenv
    fi
    echo '# pipenv' >>~/.zshrc
    echo 'alias pipenv="$HOME/.local/bin/pipenv"' >>~/.zshrc
    ;;
  esac
}

javaDevelopEnv() {
  case ${1} in
  1)
    info "Oracle JDK"
    sudo add-apt-repository -y ppa:webupd8team/java
    sudo apt update >/dev/null
    sudo apt install -y oracle-java8-set-default
    ;;
  2)
    info "maven: A software project management and comprehension tool"
    aptInstall maven
    ;;
  esac
}

javaScriptDevelopEnv() {
  case ${1} in
  1)
    info "nvm: Node Version Manager - Simple bash script to manage multiple active node.js versions"
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.0/install.sh | bash
    ;;
  esac
}

dockerDevelopEnv() {
  case ${1} in
  1)
    info "docker-ce"
    curl https://get.docker.com/ | bash
    ;;
  2)
    info "docker-compose: a tool for defining and running multi-container Docker applications"
    if cmdCheck pip3 -eq 0; then
      python3 -m pip install --user docker-compose
    fi
    ;;
  esac
}

humansTerminal() {
  case ${1} in
  1)
    aptInstall "zsh"
    git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
    cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

    # info "Configure ~/.zshrc"
    # info "Set theme to "Powerlevel10k""
    # git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    # sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc

    # info "Configure ~/.p10k.zsh"
    # info "Update "Powerlevel10k" theme"
    # cp config/p10k ~/.p10k.zsh

    info "Enable plugin: extract"
    sed -i 's/plugins=(/plugins=(extract /' ~/.zshrc

    info "Enable plugin: sudo"
    sed -i 's/plugins=(/plugins=(sudo /' ~/.zshrc

    info "Enable zsh plugin:zsh-syntax-highlighting"
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    sed -i 's/plugins=(/plugins=(zsh-syntax-highlighting /' ~/.zshrc

    info "Enable zsh plugin:z"
    sed -i 's/plugins=(/plugins=(z /' ~/.zshrc

    info "Configure ~/.vimrc"
    touch ~/.vimrc
    echo -e "syntax enable\nset cursorline\nset tabstop=4\nset shiftwidth=4\nset expandtab\nset softtabstop=-1\nset background=dark\nset ruler\ncolorscheme ron" >>~/.vimrc

    info "Configure Command aliases"
    echo -e "\n# To customize prompt, run \`p10k configure\` or edit ~/.p10k.zsh.\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh\n# Command aliases\nalias zshconfig=\"vim ~/.zshrc\"\nalias ohmyzsh=\"vim ~/.oh-my-zsh\"\nalias lc=\"colorls -lA --sd\"\nalias ll=\"ls -halF\"\nalias la=\"ls -AF\"\nalias ls=\"ls -CF\"\nalias l=\"ls -CF\"\nalias grep=\"grep --color=auto\"" >>~/.zshrc
    chsh -s $(which zsh)
    ;;
  2)
    info "tmux"
    aptInstall "tmux"

    info "Configure ~/.tmux.conf"
    info "Update hotkeys"
    cp config/tmux ~/.tmux.conf
    # info "Install nord-tmux theme"
    # git clone https://github.com/arcticicestudio/nord-tmux ~/.tmux/themes/nord-tmux
    # echo "run-shell "~/.tmux/themes/nord-tmux/nord.tmux"" >>~/.tmux.conf
    ;;
  esac
}

# 修改 SSH 端口
ConfigureSSHSecurity() {
  case ${1} in
  1)
    # Configure ssh Security
    info "Configure ssh Security"
    read -p "Enter the ssh port number(Default: 22): " sshport
    # 修改默认 SSH 端口
    sed -i '/^Port/s/Port 22/Port '$sshport'/g' /etc/ssh/sshd_config.d/sshscy.conf
    systemctl restart sshd
    success "Configure SSH security Success, Port $sshport\n SSH 安全配置完成，端口: $sshport "
    ;;
  2)
    # 添加新用户
    read -p "Enter your user name: " sshusname
    printf "Enter password: \n"
    read -s -r sshupass
    printf "Confirm password: \n"
    read -s -r sshupasswd
    if [ $sshupass != $sshupasswd ]; then
      printf "The password was entered incorrectly twice, please re-enter: \n"
      ConfigureSSHSecurity 2
    else
      printf "Enter your ssh-rsa key (*Only allow key login after restart, prohibit root user login with password): \n"
      read sshrsa
      sudo useradd -G sudo $sshusname && echo $Password | passwd --stdin $sshusname &>/dev/null
      sudo mkdir -p /home/$sshusname/.ssh && sudo touch /home/$sshusname/.ssh/authorized_keys && chown $sshusname:$sshusname /home/$sshusname/.ssh && chmod 700 /home/$sshusname/.ssh
      sudo echo "$sshrsa" >>/home/$sshusname/.ssh/authorized_keys && chown $sshusname:$sshusname /home/$sshusname/.ssh/authorized_keys && chmod 600 /home/$sshusname/.ssh/authorized_keys
      sudo echo "$sshusname  ALL=(ALL:ALL) NOPASSWD: ALL" >>/etc/sudoers
    fi
    sed -i 's/AllowUsers/AllowUsers '$sshusname' /' /etc/ssh/sshd_config.d/sshscy.conf
    success "Create SSH User Success, Port $sshport\n SSH 安全配置完成，端口: $sshport "
    ;;
  3)
    # 添加 zsh
    checkname=$(cat /etc/passwd | grep $usname | awk -F ':' '{print $1}')
    if [ $checkname == $usname ]; then
    info "Configure $usname's ~/.zshrc"
    cp -r ~/.oh-my-zsh/ /home/$usname/.oh-my-zsh/ && cp ~/.zshrc /home/$usname/.zshrc && cp ~/.vimrc /home/$usname/.vimrc && cp ~/.tmux.conf /home/$usname/.tmux.conf && cp ~/.p10k.zsh /home/$usname/.p10k.zsh
    sleep 5
    chown -R $usname:$usname /home/$usname/
    else
      info ""
    fi
    ;;
  esac
}

# System Optimization
SystemOptimization() {
  info "System Optimization"
  case ${1} in
  1)
    # Configure timezone
    info "Configure timezone"
    timedatectl | grep "Asia/Shanghai" &>/dev/null
    if [ $? -eq 0 ]; then
      warn "System timezone is Asia/Shanghai.\n 系统时区为Asia/Shanghai。"
    else
      timedatectl set-local-rtc 0 && timedatectl set-timezone Asia/Shanghai
    fi
    success "Timezone & Sync network time complete.\n 设置时区和同步网络时间完成。"

    info "Configure ulimit"
    if [ ! -z "$(grep ^ulimit /etc/rc.local)" -a "$(grep ^ulimit /etc/rc.local | awk '{print $3}' | head -1)" != '655360' ]; then
      sed -i 's@^ulimit.*@ulimit -SHn 655360@' /etc/rc.local
    else
      sed -i '$ a\ulimit -SHn 655360' /etc/rc.local
    fi
    echo -e "* soft nproc 102400\n* hard nproc 102400\n* soft nofile 102400\n* hard nofile 102400" >>/etc/security/limits.conf
    ulimit -n 102400
    success "Ulimit config complete.\n Ulimit配置完成。"

    # Configure sysctl
    info "Configure sysctl"
    cp -f /etc/sysctl.conf /etc/sysctl.conf.bak
    cat /dev/null >/etc/sysctl.conf
    echo -e "fs.file-max = 6553600\nvm.swappiness = 0\nvm.dirty_ratio = 20\nvm.dirty_background_ratio = 5\nfs.suid_dumpable = 0\nnet.core.somaxconn = 65535\nnet.core.netdev_max_backlog = 262144\n# 开启SYN洪水攻击保护\nnet.ipv4.tcp_syncookies = 1\n# 开启重用。允许将TIME-WAIT sockets 重新用于新的TCP 连接\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_fin_timeout = 30\n# 当keepalive 起用的时候，TCP 发送keepalive 消息的频度。缺省是2 小时\nnet.ipv4.tcp_keepalive_time = 600\n# timewait的数量，默认18000\nnet.ipv4.tcp_max_tw_buckets = 8000\n# 开启反向路径过滤\nnet.ipv4.conf.all.rp_filter = 1\n# IP 转发 默认关闭\nnet.ipv4.ip_forward=1" >>/etc/sysctl.conf
    success "sysctl config complete.\n sysctl 配置完成。"
    # Disable postfix serivces
    info "Disable postfix serivces"
    systemctl stop postfix && systemctl disable postfix

    # Disable ipv6
    info "Disable ipv6"
    sed -i '$ a\net.ipv6.conf.all.disable_ipv6 = 1\nnet.ipv6.conf.default.disable_ipv6 = 1' /etc/sysctl.conf
    sed -i '$ a\AddressFamily inet' /etc/ssh/sshd_config
    systemctl restart sshd
    /usr/sbin/sysctl -p

    # Configure password rules
    info "Configure password rules"
    # add cracklib password security module
    sudo apt-get install libpam-cracklib -y
    sed -i 's/difok=3/difok=3 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1/g' /etc/pam.d/common-password
    ;;
  esac
}

# 配置 bashrc
Configurebashrc() {
  case ${1} in
  1)
    info "Starting bashrc config...\n 开始配置终端变量..."
    cp -f /etc/bash.bashrc /etc/bash.bashrc-bak
    cp -f ~/.bashrc ~/.bashrc-bak
    echo "export PS1='\[\e[37;1m\][\[\e[35;49;1m\]\u\[\e[32;1m\]@\[\e[34;1m\]\h \[\e[37;1m\]➜ \[\e[31;1m\]\w \[\e[33;1m\]\t\[\e[37;1m\]]\[\e[32;1m\]$\[\e[m\] '" >>/etc/bash.bashrc
    echo "export PS1='\[\e[37;1m\][\[\e[35;49;1m\]\u\[\e[32;1m\]@\[\e[34;1m\]\h \[\e[37;1m\]➜ \[\e[31;1m\]\w \[\e[33;1m\]\t\[\e[37;1m\]]\[\e[32;1m\]$\[\e[m\] '" >>~/.bashrc
    sudo echo "export PS1='\[\e[37;1m\][\[\e[35;49;1m\]\u\[\e[32;1m\]@\[\e[34;1m\]\h \[\e[37;1m\]➜ \[\e[31;1m\]\w \[\e[33;1m\]\t\[\e[37;1m\]]\[\e[32;1m\]#\[\e[m\] '" >>/root/.bashrc
    sed -i '$ a\set -o vi\nalias vi="vim"\nalias ll="ls -ahlF --color=auto --time-style=long-iso"\nalias ls="ls --color=auto --time-style=long-iso"\nalias grep="grep --color=auto"\nalias fgrep="fgrep --color=auto"\nalias egrep="egrep --color=auto"' /etc/bash.bashrc
    sed -i '$ a\set -o vi\nalias vi="vim"\nalias ll="ls -ahlF --color=auto --time-style=long-iso"\nalias ls="ls --color=auto --time-style=long-iso"\nalias grep="grep --color=auto"\nalias fgrep="fgrep --color=auto"\nalias egrep="egrep --color=auto"' ~/.bashrc
    success "bashrc set OK!!\n 终端变量设在完成！！"
    ;;
  esac
}


help() {
	echo "Usage: bash init.sh [type] [target] [options]"
	echo
	echo "TYPE and TARGET"
	echo
	echo "[update]"
  echo "	update the running kernel."
	echo "[source]"
	echo "	apt:    http://mirrors.ustc.edu.cn/ubuntu/"
	echo "	pip:    https://pypi.tuna.tsinghua.edu.cn/simple"
	echo "	docker: https://docker.mirrors.ustc.edu.cn"
	echo "[common]"
	echo "	aira2: A lightweight multi-protocol & multi-source command-line download utility"
	echo "	tldr: Simplified and community-driven man pages"
	echo "	ag: A code-searching tool similar to ack, but faster."
	echo "	fd: A simple, fast and user-friendly alternative to 'find'"
	echo "	bat: A cat(1) clone with syntax highlighting and Git integration."
	echo "	exa: exa is a modern replacement for ls."
	echo "[python]"
	echo "	pip: pip3"
	echo "	pyenv: Simple Python version management"
	echo "	pipenv: Python Development Workflow for Humans"
	echo "[java]"
	echo "	jdk: Oracle JDK"
	echo "	maven: A software project management and comprehension tool"
	echo "[javascript]"
	echo "	nvm: Node Version Manager - Simple bash script to manage multiple active node.js versions"
	echo "[docker]"
	echo "	docker-ce: "
	echo "	docker-compose: A tool for defining and running multi-container Docker applications"
	echo "[terminal]"
	echo "	oh-my-zsh: a delightful, open source, community-driven framework for managing your Zsh configuration."
	echo "	zshrc: Configure ~/.zshrc: Powerlevel10k;Plugins:extract/sudo/zsh-syntax-highlighting/z"
	echo "	tmux: terminal multiplexer"
	echo "	tmux.conf: Configure ~/.tmux.conf"
	echo
	echo "OPTIONS"
	echo
	echo " -b,--basic 	Basic Tools Install: curl,git,vim,sed"
	echo " -v,--Version 	Show version"
	echo " -h,--help 	Show this help message and exit"
	echo
	echo "Example:"
	echo
	echo "	Update System"
	echo "		bash init.sh update"
	echo "	Install java maven"
	echo "		bash init.sh java meven"
	echo "	Install all shell tools"
	echo "		bash init.sh shell"
}

main() {
	if [ $# -eq 0 ]; then
		welcome
		echo "Usage: bash init.sh [type] [target] [options]"
		echo
		echo "init.sh [--help|-h] [--version|-v] [--basic|-b]"
		echo "	{update,source,python,java,javascript,docker,shell} [target]"
		echo
		cmdCheck curl
		cmdCheck git
	else
		case $@ in
		"update")
			updateANDUpgradeSystem
			;;
		"source")
			changeSourceForChina 1
			changeSourceForChina 2
			changeSourceForChina 3
			;;
		"source apt")
			changeSourceForChina 1
			;;
		"source pip")
			changeSourceForChina 2
			;;
		"source docker")
			changeSourceForChina 3
			;;
		"common")
			commonTools 1
			commonTools 2
			commonTools 3
			commonTools 4
			commonTools 5
			commonTools 6
			;;
		"common aira2")
			commonTools 1
			;;
		"common tldr")
			commonTools 2
			;;
		"common ag")
			commonTools 3
			;;
		"common fd")
			commonTools 4
			;;
		"common bat")
			commonTools 5
			;;
		"common exa")
			commonTools 6
			;;
		"python")
			pythonDevelopEnv 1
			pythonDevelopEnv 2
			pythonDevelopEnv 3
			;;
		"python pip")
			pythonDevelopEnv 1
			;;
		"python pyenv")
			pythonDevelopEnv 2
			;;
		"python pipenv")
			pythonDevelopEnv 3
			;;
		"java")
			javaDevelopEnv 1
			javaDevelopEnv 2
			;;
		"java jdk")
			javaDevelopEnv 1
			;;
		"java maven")
			javaDevelopEnv 2
			;;
		"javascript")
			javaScriptDevelopEnv 1
			;;
		"javascript nvm")
			javaScriptDevelopEnv 1
			;;
		"docker")
			dockerDevelopEnv 1
			dockerDevelopEnv 2
			;;
		"docker docker-ce")
			dockerDevelopEnv 1
			;;
		"docker docker-compose")
			dockerDevelopEnv 2
			;;
		"terminal")
			humansTerminal 1
			humansTerminal 2
			humansTerminal 5
			humansTerminal 6
			;;
		"terminal zsh")
			humansTerminal 1
			;;
		"terminal zshrc")
			humansTerminal 2
			;;
		"terminal tmux")
			humansTerminal 5
			;;
		"terminal tmux.conf")
			humansTerminal 6
			;;
		--basic | -b)
			basicToolsInstall
			;;
		--version | -v)
			echo "Version: ${VERSION}"
			;;
		--help | -h)
			help
			;;
		esac
	fi
}

main $@
